{% extends "admin/layout.html" %}

{% import "ui/admin_page.html" as pg %}

{% block content %}
<section class="content-header">
    <h1>微电影管理系统</h1>
    <ol class="breadcrumb">
        <li><a href="{{ url_for('admin.user_list',page=1) }}"><i class="fa fa-dashboard"></i> 会员管理</a></li>
        <li class="active">会员列表</li>
    </ol>
</section>
<section class="content" id="showcontent">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title">会员列表</h3>
                    <div class="box-tools">
                        <div class="input-group input-group-sm" style="width: 150px;">
                            <input type="text" name="table_search" class="form-control pull-right"
                                   placeholder="请输入关键字...">

                            <div class="input-group-btn">
                                <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box-body table-responsive no-padding">
                    {% include "admin/layout/flash_message.html" %}
                    <table class="table table-hover">
                        <tbody>
                        <tr>
                            <th>编号</th>
                            <th>昵称</th>
                            <th>邮箱</th>
                            <th>手机</th>
                            <th>头像</th>
                            <th>状态</th>
                            <th>注册时间</th>
                            <th>操作事项</th>
                        </tr>
                        {% for v in page_data.items %}
                        <tr>
                            <td>{{ v.id }}</td>
                            <td>{{ v.name }}</td>
                            <td>{{ v.email }}</td>
                            <td>{{ v.phone }}</td>
                            <td>
                                {% if v.avatar %}
                                <img src="{{ url_for('static',filename='uploads/user/'+v.avatar) }}" class="img-responsive center-block image-small" alt="">
                                {% else %}
                                <img src="holder.js/60x60" class="img-responsive center-block image-small" alt="">
                                {% endif %}
                            </td>
                            <td>{{ v.status }}</td>
                            <td>{{ v.addtime }}</td>
                            <td>
                                <a class="label label-success" href="{{ url_for('admin.user_view',id=v.id) }}">查看</a>

                                {% if v.status==0 %}&nbsp;
                                <a class="label label-info">解冻</a>
                                {% endif %}&nbsp;
                                {% if v.status==1 %}&nbsp;
                                <a class="label label-warning">冻结</a>
                                {% endif %}&nbsp;
                                <a href="{{ url_for('admin.user_del',id=v.id) }}" class="label label-danger">删除</a>
                            </td>
                        </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {{ pg.page(page_data,'admin.user_list') }}
                </div>
            </div>
        </div>
    </div>
</section>
{% endblock %}

{% block js %}
    <script>
        $(function(){
            $('#a-5').addClass("active");
            $('#a-5-1').addClass("active");
        })
    </script>
{% endblock %}